class HorsedatasController < ApplicationController
  # GET /horsedatas
  # GET /horsedatas.xml
  def index
    @horsedatas = Horsedata.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @horsedatas }
    end
  end

  # GET /horsedatas/1
  # GET /horsedatas/1.xml
  def show
    @horsedata = Horsedata.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @horsedata }
    end
  end

  # GET /horsedatas/new
  # GET /horsedatas/new.xml
  def new
    @horsedata = Horsedata.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @horsedata }
    end
  end

  # GET /horsedatas/1/edit
  def edit
    @horsedata = Horsedata.find(params[:id])
  end

  # POST /horsedatas
  # POST /horsedatas.xml
  def create
    @horsedata = Horsedata.new(params[:horsedata])

    respond_to do |format|
      if @horsedata.save
        flash[:notice] = 'Horsedata was successfully created.'
        format.html { redirect_to(@horsedata) }
        format.xml  { render :xml => @horsedata, :status => :created, :location => @horsedata }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @horsedata.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /horsedatas/1
  # PUT /horsedatas/1.xml
  def update
    @horsedata = Horsedata.find(params[:id])

    respond_to do |format|
      if @horsedata.update_attributes(params[:horsedata])
        flash[:notice] = 'Horsedata was successfully updated.'
        format.html { redirect_to(@horsedata) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @horsedata.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /horsedatas/1
  # DELETE /horsedatas/1.xml
  def destroy
    @horsedata = Horsedata.find(params[:id])
    @horsedata.destroy

    respond_to do |format|
      format.html { redirect_to(horsedatas_url) }
      format.xml  { head :ok }
    end
  end
end
